package com.stylefeng.guns.core.util;

import com.stylefeng.guns.common.persistence.model.TimerLog;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;

/**
 * Created by lyz on 2018/1/25.
 */
public class TimerLogUtil {

    public static TimerLog generateFinalFimerLog (TimerLog timerLog,StringBuilder sb){
        if (StringUtils.isEmpty(sb.toString())) {
            timerLog.setMemo("成功");
            timerLog.setStatus(1);
            timerLog.setEndtime(new Date());
        } else {
            timerLog.setMemo(sb.toString());
            timerLog.setStatus(0);
            timerLog.setEndtime(new Date());
        }
        return timerLog;
    }
}
